package com.vinci.webtrading.dao.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name="HISTORIQUE")
public class Historique {
	
		private Integer id;
		private Date dateFermeture;
		private String libelleDevise;
		private Double montant;
		private Double tauxOuverture;
		private Double tauxFermeture;
		private Double benefice;
		private Operation operation;
		
		public Historique() {
			super();
			// TODO Auto-generated constructor stub
		}
		@Id
		@GeneratedValue(strategy=GenerationType.AUTO)
		@Column(name="HISTORIQUE_ID")
		public Integer getId() {
			return id;
		}
		public void setId(Integer id) {
			this.id = id;
		}
		
		@Column(name="DATEFERMETURE")
		public Date getDateFermeture() {
			return dateFermeture;
		}
		public void setDateFermeture(Date dateFermeture) {
			this.dateFermeture = dateFermeture;
		}
		
		@Column(name="LIBELLEDEVISE")
		public String getLibelleDevise() {
			return libelleDevise;
		}
		public void setLibelleDevise(String libelleDevise) {
			this.libelleDevise = libelleDevise;
		}
		
		@Column(name="MONTANT")
		public Double getMontant() {
			return montant;
		}
		public void setMontant(Double montant) {
			this.montant = montant;
		}
		
		@Column(name="TAUXOUVERTURE")
		public Double getTauxOuverture() {
			return tauxOuverture;
		}
		public void setTauxOuverture(Double tauxOuverture) {
			this.tauxOuverture = tauxOuverture;
		}
		
		@Column(name="TAUXFERMETURE")
		public Double getTauxFermeture() {
			return tauxFermeture;
		}
		public void setTauxFermeture(Double tauxFermeture) {
			this.tauxFermeture = tauxFermeture;
		}
		
		@Column(name="BENEFICE")
		public Double getBenefice() {
			return benefice;
		}
		public void setBenefice(Double benefice) {
			this.benefice = benefice;
		}
		
		@ManyToMany(mappedBy="historique", fetch=FetchType.LAZY)
		public Operation getOperation() {
			return operation;
		}
		public void setOperation(Operation operation) {
			this.operation = operation;
		}
		@Override
		public String toString() {
			return "Historique [id=" + id + ", dateFermeture="
					+ dateFermeture + ", libelleDevise=" + libelleDevise
					+ ", montant=" + montant + ", tauxOuverture=" + tauxOuverture
					+ ", tauxFermeture=" + tauxFermeture + ", benefice=" + benefice
					+ "]";
		}
		
	
	
	
}
